package com.zhangdi.zddemo.thread;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AImpl implements TestA {
    @Autowired
    TestB testB;

    int flag = 1;
    Thread thread;
    @Override
    public void run() {
        System.out.println("aaa " + flag);
        flag += 1;
        thread = new Thread(new Runnable() {
            @Override
            public void run() {
                testB.run();
            }
        });
        thread.setName("BT");
        thread.start();
    }

    @Override
    public void stop() {
        thread.interrupt();
//        testB.stop();
    }

}
